package com.kunchi.oms.order.api;

import com.kunchi.isb.base.dto.ISBDto;
import com.kunchi.isb.base.exception.ISBException;
import com.kunchi.isb.base.result.ISBResult;
import com.kunchi.isb.service.ISBJsonParamService;
import com.kunchi.oms.order.po.Order;
import com.kunchi.oms.order.service.OrderService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(value = "订单", tags = {"orderAll"},description = "查询全部订单")
@RestController
@RequestMapping("/oms/OrderFindAll")
public class OrderFindAllApi extends ISBJsonParamService<ISBDto, List<Order>> {
    @Autowired
    OrderService orderService;
    @Override
    protected ISBResult doService(ISBResult<List<Order>> isbResult, ISBDto isbDto) throws ISBException {
        List<Order> list = orderService.findAll();
        isbResult.setBody(list);
        return isbResult;
    }
}
